cat <<EOF >/opt/kubernetes/cfg/kube-scheduler
KUBE_LOGTOSTDERR="true"
KUBE_LOG_LEVEL="4"
KUBE_API_MASTER="127.0.0.1:8080"
EOF

cat <<EOF >/usr/lib/systemd/system/kube-scheduler.service
[Unit]
Description=Kubernetes Scheduler
Documentation=https://github.com/kubernetes/kubernetes

[Service]
EnvironmentFile=-/opt/kubernetes/cfg/kube-scheduler
ExecStart=/opt/kubernetes/bin/kube-scheduler \
--logtostderr=\${KUBE_LOGTOSTDERR} \
--v=\${KUBE_LOG_LEVEL} \
--master=\${KUBE_API_MASTER} 

Restart=on-failure

[Install]
WantedBy=multi-user.target
EOF

systemctl daemon-reload
systemctl enable kube-scheduler
systemctl restart kube-scheduler
systemctl status kube-scheduler

echo -e "\033[42;37m==kube-scheduler配置完成===============================================================================\033[0m"
